<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<base href="http://localhost:8080/HibernateDemo02_2/">
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
</head>
<body>
	<a href="user/add.do" class="btn btn-primary btn-lg active" style="position: relative; top: 10px;">添加</a>
	<hr style="background-color: black;height: 1px;border: none;">
	
	<table class="table table-bordered">
		<tr>
			<td>序号</td>
			<td>账号</td>
			<td>密码</td>
			<td>性别</td>
			<td>生日</td>
			<td>操作</td>
		</tr>
		<c:set var="i" value="0"></c:set>
		<c:forEach items="${users }" var="user">
			<c:set var="i" value="${i+1 }"></c:set>
			<tr>
				<td>${i }</td>
				<td>${user.account }</td>
				<td>${user.password }</td>
				<td>${user.sex }</td>
				<td>${user.lastLogin }</td>
				<td>
					<a href="user/edit.do?id=${user.id }" class="btn btn-primary btn-lg active">修改</a>
					<br>
					<a href="user/delete.do?id=${user.id }" class="btn btn-primary btn-lg active">删除</a>
				</td>
			</tr>
		</c:forEach>
	</table>
	
</body>
</html>